import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/topic/getList',
    method: 'get',
    params
  })
}

export function getCategoryList(params) {
  return request({
    url: '/topic/getCategoryList',
    method: 'get',
    params
  })
}

export function createCategory(data) {
  return request({
    url: '/topic/createCategory',
    method: 'post',
    data
  })
}

export function createTopic(data) {
  return request({
    url: '/topic/createTopic',
    method: 'post',
    data
  })
}
export function deleteById(id) {
  return request({
    url: `/topic/deleteById/${id}`,
    method: 'delete'
  })
}

export function deleteCategoryById(id) {
  return request({
    url: `/topic/deleteCategoryById/${id}`,
    method: 'delete'
  })
}

export function update(data) {
  return request({
    url: `/topic/update`,
    method: 'put',
    data
  })
}
